#include <cstdio>

int main( )
{
    int t, n, s, a, q;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        s = 0;
        q = 0;
        while ( n-- )
        {
            scanf("%d", &a);
            s ^= a;
            if ( a > 1 )
                q = 1;
        }
        if ( s && q || !s && !q )
            puts("John");
        else
            puts("Brother");
    }
    return 0;
}
